package com.juhuixing.user.server.business.service;

import com.juhuixing.common.config.service.BaseService;
import com.juhuixing.common.dto.UserDetailDTO;
import com.juhuixing.common.model.TokenData;
import com.juhuixing.user.server.persistence.entity.BaseUser;

/**
 * 功能描述: 用户服务类
 * @methodName
 * @author: 刘猛
 * @date: 2019/5/14 16:39
 * @param: 
 * @return: 
 **/
public interface UserService extends BaseService<BaseUser> {
    
    BaseUser findByUsername(String username);

    /**
     * 功能描述: 生成短信验证码
     * @methodName createSmsCode
     * @author: 刘猛
     * @date: 2019/4/24 17:47
     * @param: [phone]
     * @return: java.lang.Boolean
     **/
    String createSmsCode(String phone);

    /**
     * 功能描述: 使用手机号登录
     * @methodName phoneLogin
     * @author: 刘猛
     * @date: 2019/4/25 13:49
     * @param: [phone, smsCode]
     * @return: com.juhuixing.common.model.TokenData
     **/
    TokenData phoneLogin(String phone, String smsCode,String source);

    /**
     * 功能描述:
     * @methodName 首次使用微信登录
     * @author: 刘猛
     * @date: 2019/4/25 16:18
     * @param: [phone, smsCode, headPic, sex, birthday, openId, unionId]
     * @return: com.juhuixing.common.model.TokenData
     **/
    TokenData wechatLogin( String phone,
                           String avatar,
                           String nickName,
                           String petNickname,
                           Integer sex,
                           String birthday,
                           String openId,
                           String unionId,
                           String petImage,
                           String backImage,
                           String voiceIntro,
                           String petVoice,
                           Integer petType,
                           String source,
                           String wxavatar,
                           String wxnickname,
                           Integer gender,
                           String province,
                           String city);

    /**
     * 功能描述: 账号密码登录
     * @methodName pwdLogin
     * @author: 刘猛
     * @date: 2019/5/20 9:43
     * @param: [username, password]
     * @return: com.juhuixing.common.model.TokenData
     **/
    TokenData pwdLogin(String username, String password);

    /**
     * 功能描述: 获取用户详细信息
     * @methodName getUserDetail
     * @author: 刘猛
     * @date: 2019/6/2 13:32
     * @param: [currentUserName, baseUserDTOClass]
     * @return: com.juhuixing.common.dto.UserDetailDTO
     **/
    UserDetailDTO getUserDetail(String currentUserName);
}
